<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
  <head>
    <base href="<%=basePath%>" />
    <title>Custom Query Data of Temperature Spots Data</title>
    <script type="text/javascript">
		var path = "<%=basePath%>";
	</script>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>beshs/css/content.css" />
	<link type="text/css" href="<%=basePath%>beshs/css/frame_style.css" rel="stylesheet" />
	<link type="text/css" href="<%=basePath%>beshs/css/element_style.css" rel="stylesheet" />
	<script type="text/javascript" src="<%=basePath%>resources/jquery/jquery-1.7.2.min.js"></script>
	<!-- 页面特效 -->
	<jsp:include page="/beshs/res-refer/page-effect-reference.jsp" />
	<!-- 系统通用资源 -->
	<jsp:include page="/resources/resource-refer/common-resource-reference.jsp" />
	<!-- 用户访问菜单路径 -->
	<jsp:include page="/resources/usertrace/common-uservisit-reference.jsp" />
	<!-- iframe高度自适应 -->
	<script type="text/javascript">
        function getOsName() { 
    		var OsObject = ""; 
		   	if(navigator.userAgent.indexOf("MSIE")>0) { 
		    	return "MSIE"; 
		   	} 
		   	if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
		        return "Firefox"; 
		   	} 
		   	if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
		        return "Safari"; 
		   	}  
		  	if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
		        return "Camino"; 
		   	} 
		   	if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
		        return "Gecko"; 
		   	} 
		} 
        
        /** 根据浏览器类型选择iframe自适应方式 **/
        function setIframeHeightAutosize() {
        	//获取Iframe对象 ie和firefox都可以获得
        	var listIframe = document.getElementById("tempPointDataListMgr"); 
        	var chartIframe = document.getElementById("tempPointDataChartMgr");
        	try{
                if(getOsName() == 'MSIE'){
                	//列表
                    var lbHeight = listIframe.document.body.scrollHeight; //IE
                    listIframe.style.height =  lbHeight + "px"; 
                    //线性图
                    var cbHeight = chartIframe.document.body.scrollHeight; //IE
                    chartIframe.style.height =  cbHeight + "px"; 
                }else if(getOsName() == 'Firefox'){
                	//列表
                    var lfHeight = listIframe.contentDocument.body.scrollHeight; //FireFox 
                    listIframe.height = lfHeight + "px";   
                    //线性图
                    var cfHeight = chartIframe.contentDocument.body.scrollHeight; //FireFox 
                    chartIframe.height = cfHeight + "px";       
                } else {
                    listIframe.style.height = 400 + "px";
                    chartIframe.style.height = 400 + "px";                
                }          
            } catch (ex){}
		}
	function excelExport() {
		var buildingUID = "<s:property value='building.id' />";
		var recordTime = "<s:date name='recordTime' format='yyyy-MM-dd' nice='false' />";
		window.open(path + "beshs/temperaturePointDataGatherAction!exportTempPointDetailData.do?date="+new Date()
			+"&buildingUID="+ buildingUID
			+"&recordTime="+recordTime,"_blank");
		}

		
		
		$(function() {
			setIframeHeightAutosize();
		})
    </script>
  </head>
  <body>
  	<div class="content_all">
  		<!--导航条-->
  		<div class="insertinfo_table">
		  	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  		<tr>
		  			<th style="text-align: center;" colspan="6" >Custom Query Data of Temperature Spots Data</th>
		  		</tr>
		  		<tr>
		          	<th>Project：</th>
		          	<td><s:property value='project.projectName' /></td>
		          	<th>District：</th>
		        	<td><s:property value='community.communityName' /></td>
		        	<th>Building：</th>
		        	<td><s:property value='building.buildingID' /></td>
		  		</tr>
		  		<tr>
		  			<th>Temprature Spot Quantity：</th>
		        	<td><s:property value='tempPointNum' /></td>
		          	<th>Meter Reading Date：</th>
		          	<td><s:date name='recordTime' format='yyyy-MM-dd' nice='false' /></td>
		          	<th>Upload Quantity：</th>
		        	<td><s:property value='tempPointDataCounter' /></td>
		        </tr>
		        <tr>
		  			<th></th>
		        	<td style="border:none" colspan="5">
          				<script type="text/javascript">
          					$(function() {
          						$("input[name='goBack']").click(function() {
          							history.go(-1);
          							//window.location = path + "beshs/tempPointDataStatisticsAction!queryTempPointDataMgrNav.do?date="+new Date();
          						});
          						
          						$("input[name='refresh']").click(function() {
          							var buildingUID = "<s:property value='building.id' />";
  									var recordTime = "<s:date name='recordTime' format='yyyy-MM-dd' nice='false' />";
  									//加载温度点数据列表
  									window.frames["tempPointDataListMgr"].location = path + "beshs/temperaturePointDataGatherAction!queryBuildingTpDataList.do?date="+new Date() 
							   				+"&buildingUID=" + buildingUID
							   				+"&recordTime=" + recordTime;
						   			//加载批次温度点数据线性图
  									window.frames["tempPointDataChartMgr"].location = path + "beshs/temperaturePointDataGatherAction!queryBuildingTpDataChart.do?date="+new Date()
			  								+"&buildingUID="+ buildingUID
			  								+"&recordTime="+recordTime;
          						});
          					})
          				</script>
          				<input name="refresh" type="button" value="Refresh" class="s_btn"/>&nbsp;&nbsp;
            			<input name="goBack" type="button" value="Return" class="s_btn"/>
            			<input name="excelExport" type="button" value="Data Export" onclick="excelExport()" class="s_btn"/>
            			</td>
		        </tr>
		    </table>
		</div>
	</div>
	<div class="clear"></div>
	<div class="content_all">
		<!--查询列表-->
  		<ul class="nav_menu"><!--选项卡开始-->
    		<li class="selected"><span>Data List</span></li>
    		<li><span>Linear Graph</span></li>
  		</ul>
  		<div class="nav_content">
   	 		<div class="ct">
   	 			<script type="text/javascript">
   	 				$(function() {
   	 					var buildingUID = "<s:property value='building.id' />";
  						var recordTime = "<s:date name='recordTime' format='yyyy-MM-dd' nice='false' />";
  						window.frames["tempPointDataListMgr"].location = path + "beshs/temperaturePointDataGatherAction!queryBuildingTpDataList.do?date="+new Date() 
				   				+"&buildingUID=" + buildingUID
				   				+"&recordTime=" + recordTime;
   	 				});
   	 			</script>
   	 			<iframe frameborder="0" name="tempPointDataListMgr" scrolling="auto" id="tempPointDataListMgr" src="" height="90%" width="100%" ></iframe>
   	 		</div>
    		<div class="ct">
    			<script type="text/javascript">
    				$(function() {
    					var buildingUID = "<s:property value='building.id' />";
  						var recordTime = "<s:date name='recordTime' format='yyyy-MM-dd' nice='false' />";
  						window.frames["tempPointDataChartMgr"].location = path + "beshs/temperaturePointDataGatherAction!queryBuildingTpDataChart.do?date="+new Date()
  								+"&buildingUID="+ buildingUID
  								+"&recordTime="+recordTime;
    				});
    			</script>
    			<iframe frameborder="0" name="tempPointDataChartMgr" scrolling="auto" id="tempPointDataChartMgr" src="" height="90%" width="100%"></iframe>
    		</div>
  		</div><!--选项卡结束-->
	</div>
  </body>
</html>
